package api

import (
	"car-rental-08-14/api/handler"
	"github.com/gin-gonic/gin"
)

func LoadRouter(r *gin.Engine) {
	api := r.Group("/api")
	{
		user := api.Group("/user")
		{
			user.POST("register", handler.RegisterUser)
			user.POST("login", handler.LoginUser)
			user.GET("listByStatus", handler.GetListByStatusUser)
			user.POST("freeze", handler.FreezeUser)
		}

		car := api.Group("/car")
		{
			car.POST("addCar", handler.AddCar)
			car.GET("listCar", handler.ListCar)
			car.POST("updateCar", handler.UpdateCar)
		}

		api.POST("upload", handler.Upload)
	}
}
